<!--商品参数介绍页面-->
<template>
    <div class="product-intro">
        <div class="product-banner">
            <img :src="productData.head_img_url" :alt="productData.name">
        </div>
        <div class="product-content">
            <p v-html="productData.content"></p>
        </div>
    </div>
</template>

<script>
    export default {
        name: "ProductIntro",
        data() {
            return {
                productData: [], // 商品数据
            }
        },
        methods: {
            // 通过商品id 获取商品详情数据
            getProductDetailByID() {
                this.$axios.get(this.baseUrl + '/api/v1/product/' + this.$route.params.id)
                    .then(response => {
                        let result = response.data;
                        this.productData = result.data;
                    })
                    .catch(error => {
                        console.log(error)
                    })
            }
        },
        activated() {
            this.getProductDetailByID();
        }
    }
</script>

<style scoped>
.product-intro {
    width: 100%;
    height: auto;
}
.product-banner {
    width: 100%;
    height: auto;
    text-align: center;
    margin: 0 auto;
}
.product-banner > img {
    width: 800px;
    height: 800px;
}
.product-content {
    width: 800px;
    height: auto;
    text-align: center;
    margin: 30px auto;
}


</style>
